<#-- @ftlvariable name="entity" type="com.xci.edu.core.entity.ExamPaper" -->
<#include "/sys/_layout.ftl">
<!doctype html>
<html>
<head>
    <@pageHeader/>
</head>
<body>
<@pageLoading/>
<div class="jxpanel winpanel" data-fit="true">
    <form id="editform" class="jxform" method="post"
          action="${saveUrl("/background/examPaper/","createSave","updateSave")}">
        <input name="id" value="${entity.id}" type="hidden">
        <table class="table jxtable-form">
            <input class="hidden" name="status" checked type="checkbox" value="1" data-unchecked-value="0"/>
            <tr>
                <th class="w-150px">试卷名称</th>
                <td>
                    <input class="form-control" id="name" name="name" value="${entity.name}" maxlength="200" data-validate="required: [true,'请输入试卷名称']" autocomplete="off"/>
                </td>
            </tr>
            <tr>
                <th>科目名称</th>
                <td>
                    <select class="form-control jxselect" name="eduCategoryId" data-text-field="eduCategoryName" data-validate="required: [true,'请选择科目']"
                            data-allow-clear="true">
                        <option></option>
                        <@eduCategorySelectOption selectedValue=entity.eduCategoryId></@eduCategorySelectOption>
                    </select>
                </td>
            </tr>
            <tr>
                <th>试卷总分</th>
                <td>
                    <input class="form-control jxnumber" id="totalScore" name="totalScore" type="number" maxlength="4"
                           data-validate="required: [true,'请输入试卷总分']"
                           max="9999" data-max="9999" data-min="0"
                           data-decimals="0" data-step="1" value="${entity.totalScore}" autocomplete="off"/>
                </td>
            </tr>
            <tr>
                <th>及格分数</th>
                <td>
                    <input class="form-control jxnumber" id="passScore" name="passScore" type="number" maxlength="4"
                           data-validate="required: [true,'请输入及格分数']"
                           max="9999" data-max="9999" data-min="0"
                           data-decimals="0" data-step="1" value="${entity.passScore}" autocomplete="off"/>
                </td>
            </tr>
            <tr>
                <th>试卷展示类型</th>
                <td>
                    <select class="form-control jxselect" id="showMode" name="showMode" data-validate="required: [true,'请选择试卷展示类型']" autocomplete="off">
                        <@showModeOptions selectedValue=entity.showMode/>
                    </select>
                </td>
            </tr>
            <tr>
                <th>试卷类型</th>
                <td>
                    <select class="form-control jxselect" id="paperCategory" name="paperCategory" data-validate="required: [true,'请输入试卷类型']" onchange="setView()" autocomplete="off">
                        <@paperCategoryOptions selectedValue=entity.paperCategory/>
                    </select>
                </td>
            </tr>
            <tr id="tr-autoRadioCount">
                <th>自动生成:单选题数</th>
                <td>
                    <input class="form-control jxnumber" id="autoRadioCount" name="autoRadioCount" type="number" maxlength="3"
                           max="999" data-max="999" data-min="0"
                           data-decimals="0" data-step="1" value="${entity.autoRadioCount}" autocomplete="off"/>
                </td>
            </tr>
            <tr id="tr-autoCheckboxCount">
                <th>自动生成:多选题数</th>
                <td>
                    <input class="form-control jxnumber" id="autoCheckboxCount" name="autoCheckboxCount" type="number" maxlength="3"
                           max="999" data-max="999" data-min="0"
                           data-decimals="0" data-step="1" value="${entity.autoCheckboxCount}" autocomplete="off"/>
                </td>
            </tr>
            <tr id="tr-autoYesnoCount">
                <th>自动生成:判断题数</th>
                <td>
                    <input class="form-control jxnumber" id="autoYesnoCount" name="autoYesnoCount" type="number" maxlength="3"
                           max="999" data-max="999" data-min="0"
                           data-decimals="0" data-step="1" value="${entity.autoYesnoCount}" autocomplete="off"/>
                </td>
            </tr>
            <tr>
                <th>考试时长:(分钟)</th>
                <td>
                    <input class="form-control jxnumber" id="totalDuration" name="totalDuration" type="number" maxlength="3"
                           data-validate="required: [true,'请输入考试时长']"
                           max="999" data-max="999" data-min="0"
                           data-decimals="0" data-step="1" value="${entity.totalDuration}" autocomplete="off"/>
                </td>
            </tr>
            <tr>
                <th>试题排序</th>
                <td>
                    <select class="form-control jxselect" id="questionOrder" name="questionOrder" data-validate="required: [true,'请选择试题排序类型']" autocomplete="off">
                        <@questionOrderOptions selectedValue=entity.questionOrder/>
                    </select>
                </td>
            </tr>
            <tr>
                <th>试题选项排序</th>
                <td>
                    <select class="form-control jxselect" id="questionOptionOrder" name="questionOptionOrder" data-validate="required: [true,'请选择试题选项排序类型']" autocomplete="off">
                        <@questionOptionOrderOptions selectedValue=entity.questionOptionOrder/>
                    </select>
                </td>
            </tr>
            <tr>
                <th>开考限制;考试开始{}分钟后禁止参加考试</th>
                <td>
                    <input class="form-control jxnumber" id="forbidEnter" name="forbidEnter" type="number" maxlength="3"
                           data-validate="required: [true,'请输入开考限制;考试开始{}分钟后禁止参加考试']"
                           max="999" data-max="999" data-min="0"
                           data-decimals="0" data-step="1" value="${entity.forbidEnter}" autocomplete="off"/>
                </td>
            </tr>
            <tr>
                <th>交卷限制;开始考试{}分钟内不允许交卷</th>
                <td>
                    <input class="form-control jxnumber" id="forbidSubmit" name="forbidSubmit" type="number" maxlength="3"
                           data-validate="required: [true,'请输入交卷限制;开始考试{}分钟内不允许交卷']"
                           max="999" data-max="999" data-min="0"
                           data-decimals="0" data-step="1" value="${entity.forbidSubmit}" autocomplete="off"/>
                </td>
            </tr>
            <tr>
                <th>考试须知</th>
                <td>
                    <input class="form-control" id="notice" name="notice" value="${entity.notice}" maxlength="2000"  autocomplete="off"/>
                </td>
            </tr>
            <tr>
                <th>备注</th>
                <td>
                    <textarea class="form-control" name="remark" maxlength="500" rows="3" style="resize: none">${entity.remark}</textarea>
                </td>
            </tr>
        </table>
    </form>
    <div class="panel-footer text-right">
        <@editFormDialogCommand/>
    </div>
</div>
<@editFormPageFooter/>
<script>
    <#--  根据试卷类型选择是否展示自动生成试题选项  -->
    function setView(){
        var val = $('#paperCategory option:selected').val();
        if(val=="2"){
            $('#tr-autoRadioCount').show();
            $('#tr-autoCheckboxCount').show();
            $('#tr-autoYesnoCount').show();
        }else {
            $('#tr-autoRadioCount').hide();
            $('#tr-autoCheckboxCount').hide();
            $('#tr-autoYesnoCount').hide();
        }
    }

    setView();

</script>
</body>
</html>
